FROM adoptopenjdk/openjdk8:latest

RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo "Asia/Shanghai" > /etc/timezone

WORKDIR /app/
COPY build/libs/spring-boot-loader/ ./
COPY build/libs/dependencies/ ./
COPY build/libs/snapshot-dependencies/ ./
COPY build/libs/application/ ./

ENV JAVA_OPTS '-XX:+UseContainerSupport -XX:MaxRAMPercentage=85.0'
CMD ["sh", "-ec", "exec java ${JAVA_OPTS} org.springframework.boot.loader.JarLauncher"]